package spring.demo13.usespring;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

import org.springframework.stereotype.Component;

@Component("myPushListener")
public class MyMessageListener implements MessageListener {
	@Override
	public void onMessage(Message arg0) {
		if (arg0 instanceof TextMessage) {
			try {
				System.out.println(((TextMessage)arg0).getText());
			} catch (JMSException e) {
				e.printStackTrace();
			}
		}
	}
}
